{% extends 'sims/base.html' %}

{% block title %}
    主页
{% endblock %}

{% block description %}
    主页
{% endblock %}

{% block navbar_top %}
    <a class="nav-item nav-link active" href="{% url 'sims:index' %}">主页</a>
{% endblock %}

{% block body_content %}
    <h5 class="page-header" style="margin-top: 20px"></h5>
    <div class="row">
        <div class="col">
            <p class="h3">hello {{ request.session.user_name }}, 现在是北京时间 {% now "H:i" %},
            您有{{ user_item.thing_wait }}件待处理的日程</p>
        </div>
    </div>
    <h5 class="page-header" style="margin-top: 20px"></h5>
    <div class="row">
        <div class="col-6 pl-0">
            <div class="jumbotron">
                <h1 class="display-5">检查您的日程事项</h1>
                {% if schedule_item %}
                    <ul>
                        {% for foo in schedule_item %}
                            {% ifequal foo.status "已完成" %}
                                <li>{{ foo.title }}<span class="badge badge-success">状态：已完成</span></li>
                            {% endifequal %}
                            {% ifequal foo.status "未完成" %}
                                <li>{{ foo.title }}<span class="badge badge-danger">状态：待处理</span></li>
                            {% endifequal %}
                        {% endfor %}
                    </ul>
                {% else %}
                    <p class="lead">暂无创建的日程</p>
                {% endif %}
                <hr class="my-4">
                <p>您一共创建{{ user_item.thing_all }}个日程，已完成{{ user_item.thing_finished }}个</p>
                <p class="lead">
                    <a class="btn btn-primary btn-lg" href="{% url 'sims:schedule' %}" role="button">了解更多</a>
                </p>
            </div>
        </div>
        <div class="col-6">
            <div class="jumbotron">
                <h1 class="display-5">预览您的待办日程</h1>
                {% if wait_finish %}
                    <ul>
                        {% for foo in wait_finish %}
                            {% ifequal foo.important_level "重要" %}
                                <li>{{ foo.title }}<span class="badge badge-danger">重要性：重要</span></li>
                            {% endifequal %}
                            {% ifequal foo.important_level "一般" %}
                                <li>{{ foo.title }}<span class="badge badge-success">重要性：一般</span></li>
                            {% endifequal %}
                            {% ifequal foo.important_level "不重要" %}
                                <li>{{ foo.title }}<span class="badge badge-secondary">重要性：不重要</span></li>
                            {% endifequal %}
                        {% endfor %}
                    </ul>
                {% else %}
                    <p class="lead">暂无待办日程</p>
                {% endif %}
                <hr class="my-4">
                <p>您一共有{{ user_item.thing_wait }}项待办事件</p>
                <p class="lead">
                    <a class="btn btn-primary btn-lg" href="{% url 'sims:to_do' %}" role="button">了解更多</a>
                </p>
            </div>
        </div>
    </div>
{% endblock %}

{% block navbar_left %}
    <div class="navbar-nav">
        <a class="nav-item nav-link active" href="{% url 'sims:index' %}">主页</a>
        <a class="nav-item nav-link" href="{% url 'sims:schedule' %}">日程安排</a>
        <a class="nav-item nav-link" href="{% url 'sims:to_do' %}">待办事项</a>
        <a class="nav-item nav-link" href="{% url 'sims:history' %}">历史活动</a>
        <a class="nav-item nav-link" href="{% url 'sims:user_control' %}">个人中心</a>
    </div>
{% endblock %}